Page({
  data: {
    list: []
  },
  onLoad(e) {
    console.log(e);
    var _this = this
    getApp().req({
      url: "/customer/contactlist/" + e.id,
      cb(res) {
        console.log(res);
        
        _this.setData({
          list: res.data.Items
        })
      }
    })
  },
  radioChange(e) {
    var proview = getCurrentPages()[getCurrentPages().length - 2]
    var newlist = proview.data.info
    for (const i in this.data.list) {
      if (this.data.list[i].CustomerContactId == e.detail.value) {
        newlist.PersonName = this.data.list[i].PersonName;
        break;
      }
    }
    newlist.CustomerContactId = e.detail.value
    proview.setData({
      info: newlist
    })
    dd.navigateBack()
  }
});
